<template>
    <view>
        <view v-if="(propData || null) != null && propData.length > 0">
            <view v-for="(floor, index) in propData" :key="index">
                <view>
                    <view class="spacing-nav-title padding-horizontal-main">
                        <text class="text-wrapper" :style="'color:' + (floor.color || '#333') + ';'">{{
                            floor.title
                        }}</text>
                        <navigator
                            hover-class="none"
                            class="arrow-right"
                            style="padding-right: 40rpx; color: #888; float: right"
                            open-type="switchTab"
                            url="/pages/goods-category/goods-category"
                            >更多</navigator
                        >
                    </view>

                    <view v-if="floor.style_type == 0">
                        <view v-if="floor?.goods_list?.length > 0" class="goods-data-list">
                            <view
                                v-for="(item, index) in floor?.goods_list"
                                :key="index"
                                style="padding: 20rpx; background-color: #fff; position: relative; margin-bottom: 20rpx"
                                class="oh border-radius-main"
                            >
                                <!-- 商品主体内容 -->
                                <navigator
                                    hover-class="none"
                                    :url="`/pages/daily/service_detail?siUuid=${item.siUuid}`"
                                >
                                    <image
                                        class="goods-img"
                                        style="float: left; border-radius: 10rpx"
                                        :src="
                                            item.detail?.siPict?.length > 0
                                                ? organizationGateway +
                                                  '/file/download?filepath=' +
                                                  item.detail?.siPict[0]?.path
                                                : defaultImageBase64
                                        "
                                        mode="aspectFit"
                                    ></image>
                                    <view class="base" style="float: right">
                                        <view class="multi-text">{{ item.detail?.siName }}</view>
                                        <view class="single-text" style="color: #9a9a9a; font-size: 12px">{{
                                            item.detail?.siCont
                                        }}</view>
                                        <view class="sales-price" style="margin-top: 10rpx">{{
                                            "￥" + Number(item.ocPric)
                                        }}</view>
                                    </view>
                                </navigator>
                            </view>
                        </view>
                        <view v-else class="goods-data-list">
                            <u-empty text="暂无推荐..."> </u-empty>
                        </view>
                    </view>

                    <view v-if="floor.style_type == 1">
                        <view v-if="floor?.goods_list?.length > 0" class="goods-data-grid-list">
                            <view
                                v-for="(item, index) in floor?.goods_list"
                                :key="index"
                                style="background-color: #fff; position: relative; margin-bottom: 20rpx"
                                class="item oh border-radius-main"
                            >
                                <!-- 商品主体内容 -->
                                <navigator
                                    hover-class="none"
                                    :url="`/pages/daily/commodity_detail?ciUuid=${item.ciUuid}`"
                                >
                                    <image
                                        class="goods-img"
                                        style="display: block"
                                        :src="
                                            item.detail?.ciPict?.length > 0
                                                ? organizationGateway +
                                                  '/file/download?filepath=' +
                                                  item.detail?.ciPict[0]?.path
                                                : defaultImageBase64
                                        "
                                        mode="aspectFit"
                                    ></image>
                                    <view class="base" style="padding: 0 20rpx">
                                        <view class="goods-title multi-text" style="margin-bottom: 10rpx">{{
                                            item.detail?.ciAlna
                                        }}</view>
                                        <view class="sales-price">{{ "￥" + Number(item.ocPric) }}</view>
                                    </view>
                                </navigator>
                            </view>
                        </view>
                        <view v-else class="goods-data-list">
                            <u-empty text="暂无推荐..."> </u-empty>
                        </view>
                    </view>
                </view>
            </view>
        </view>
    </view>
</template>

<script>
import { mapGetters } from "vuex";
export default {
    data() {
        return {};
    },

    computed: {
        ...mapGetters({
            organizationGateway: "globalInfo/organizationGateway",
            defaultImageBase64: "globalInfo/defaultImageBase64",
        }),
    },
    props: {
        propLocation: {
            type: [String, Number],
            default: 0,
        },
        propData: {
            type: Array,
            default: [],
        },
    },
    methods: {},
};
</script>

<style></style>
